﻿@model  HANS_BackStage.Model.WebModel.Role.RolePagedListModel
@{
    ViewBag.Title = "角色列表";
}

<div class="x_panel">
    <!--beginHead-->
    <div class="x_title">
        <h2>角色列表<small>HANS</small></h2>
        <ul class="nav navbar-right panel_toolbox">
            <li>
                <a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
            </li>
        </ul>
        <div class="clearfix"></div>
    </div>
    <!--endHead-->
    <div class="x_content">
        <div id="datatable_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer form">
            <!--beginSearch-->
            <form>
                <div class="row">
                    <div class="col-sm-12">
                        <div class="dataTables_length" id="datatable_length">
                            <a href="@Url.Action("CreateRole")" class="btn btn-success">
                                添加 <i class="fa fa-plus"></i>
                            </a>
                        </div><div id="datatable_filter" class="dataTables_filter top_search">
                            <div class="input-group">
                                @Html.TextBoxFor(m => m.Keyword, new { @class = "form-control", @placeholder = "角色名称", @autocomplete = "off" })
                                <span class="input-group-btn">
                                    @*<a class="btn btn-success" style="color:#fff" >查询</a>*@
                                    <button class="btn btn-success" style="color:#fff" type="submit">查询</button>
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
            <!--endSearch-->
            <!--begiContent-->
            <div class="row">
                <div class="col-sm-12 ">
                    <table id="datatable" class="table table-striped table-bordered  table-hover dataTable no-footer" role="grid" aria-describedby="datatable_info">
                        @*table table-striped table-bordered table-hover*@
                        <thead>
                            <tr role="row">
                                <th>角色名称</th>
                                <th>角色描述</th>
                                <th>创建时间</th>
                                <th>创建人员</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var item in Model.PagedList)
                            {
                                <tr>
                                    <td>@Html.DisplayFor(i => item.Rolename)</td>
                                    <td>@Html.DisplayFor(i => item.Description)</td>
                                    <td>@item.Createdate.Value.ToLocalYYYYMMDDHHmmss()</td>
                                    <td>@Html.DisplayFor(i=>item.Createby)</td>
                                    <td>
                                        <a href="@Url.Action("UpdateRole","Account",new { id=item.Id})" class="btn btn-xs btn-success"><i class="fa fa-edit"></i>修改</a>
                                        <a data-confirmed-text="确认删除该角色？"
                                           data-confirmed-button="确定"
                                           data-confirmed-cancel-button="取消"
                                           data-confirmed-button-class="btn-danger"
                                           data-confirmed-url="@Url.Action("DeleteRole", "Account", new { id=item.Id})"
                                           class="btn btn-danger btn-xs js-confirm-submit">
                                            <!--js-confirm-submit js post 提交-->
                                            <i class="fa fa-trash-o"></i>移除
                                        </a>
                                    </td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
            </div>
            <!--endContent-->
            <!--beginPagination-->
            <div class="row">
                <div class="col-sm-12">
                    <div class="dataTables_paginate paging_simple_numbers" id="datatable_paginate">
                        @Html.Partial("_Pagination", Model.PagedList, Model.QueryParmeter)
                    </div>
                </div>
            </div>
            <!--endPagination-->
        </div>
    </div>
</div>
